package com.sc.nft.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sc.nft.entity.InformationArticle;
import com.sc.nft.entity.vo.AppArticleVO;
import com.sc.nft.entity.vo.AppByIdArticleVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface InformationArticleMapper extends BaseMapper<InformationArticle> {

    /**
     * 新增
     * @param informationArticle
     * @return
     */
    Integer save(@Param("data") InformationArticle informationArticle);

    /**
     * 分页获取数据
     * 先计算好页码下标在计算,只执行一次.
     * @param num
     * @param size
     * @return
     */
    List<AppArticleVO> getArticleList(@Param("num") Integer num,@Param("size") Integer size);

    /**
     * 根据id获取数据
     * @param id
     * @return
     */
    AppByIdArticleVO appSelectById(@Param("id") Long id);
    /**
     * 获取最新5条,抛出当前的条目
     *
     * @param id
     * @return
     */
    List<AppByIdArticleVO> getLimitFive(@Param("id") Long id);
}
